#include "QtUI/QtUndoableCommand.hpp"
#include "Ctrl/ControlCommand.hpp"
#include <cassert>

namespace QtUI
{
	

QtUndoableCommand::QtUndoableCommand( const QString& text, Ctrl::ControlCommand* pCtrlCommand )
	: QUndoCommand( text)
	, pImpl_( pCtrlCommand)
{
	assert( NULL != pCtrlCommand);
}

// ---------------------------------------------------------------------------------------------------------------------

void QtUndoableCommand::undo()
{
	pImpl_->undo();
}

// ---------------------------------------------------------------------------------------------------------------------

void QtUndoableCommand::redo()
{
	pImpl_->execute();
}

// ---------------------------------------------------------------------------------------------------------------------

QtUndoableCommand::~QtUndoableCommand()
{
	delete pImpl_;
}
} // namespace QtUI
